import request from '@/request/request.js'

// 登录
export default {
    /**
     * 房屋信息列表接口
     * @returns 
     */
    getHouseList(params) {
        return request({
            url: "/houseSearch/houseSearch/list",
            method: "get",
            params: {
                ...params,
                pageNum: 1,
                pageSize: 10000
            }
        });
    },
    /**
     * 房屋信息详情
     * @param { id } params houseId
     * @returns 
     */
    getHouseDetail(houseId) {
        return request({
            url: `/houseSearch/houseSearch/${houseId}`,
            method: "get",
        });
    },
    /**
     * 装修详情
     */
    getDecorationList() {
        return request({
            url: `/houseSearch/decoration/zx_list`,
            method: "get",
        });
    },
    /**
     * 装修审核详情
     */
    renovation(params) {
        return request({
            url: `/renovation/renovation/list`,
            method: "get",
            params
        })
    },
    /**
     * 装修备案新增
    */
    renovationCreate(params) {
        return request({
            url: `/renovation/renovation`,
            method: 'Post',
            data: params
        })
    },
    /**
     * 装修备案详情
     */
    renovationDetail(id) {
        return request({
            url: `/renovation/renovation/${id}`,
            method: 'Get'
        })
    },
    /**
     * 装修备案修改
     */
    renovationUpdate(params) {
        return request({
            url: `/renovation/renovation`,
            method: 'Put',
            data: params
        })
    },
    /**
     * 装修备案删除
    */
    renovationDelete(rentId) {
        return request({
            url: `/renovation/renovation/${rentId}`,
            method: 'delete',
        })
    },
    /**
     * 投诉信息
     */
    complaint(params) {
        return request({
            url: `/houseSearch/complaint/list`,
            method: "get",
            params: {
                ...params,
                pageNum: 1,
                pageSize: 10000
            }
        });
    },
    /**
     * 投诉详情
     */
    comDetail(tid) {
        return request({
            url: `/houseSearch/complaint/${tid}`,
            method: "get"
        });
    },
    /**
     * 修改投诉信息
    */
    updateComplaint(params) {
        return request({
            url: `/houseSearch/complaint`,
            method: "Put",
            data: params
        })
    },
    /**
     * 删除投诉信息
    */
    delComplaint(tid) {
        return request({
            url: `/houseSearch/complaint/${tid}`,
            method: "delete"
        })
    },
    /**
     * add 新增投诉信息
     */
    addRen(data) {
        return request({
            url: "/houseSearch/complaint",
            method: "post",
            data
        });
    },
    /**
      * 租房上传
      */
    tenantHouse(data) {
        return request({
            url: '/houseSearch/rent',
            method: 'post',
            data
        })
    },
    /**
     * 租房图片上传
    */
    uploadImage(file) {
        return request({
            url: '/common/upload',
            method: 'post',
            data: file
        })
    },
    /**
     * 租房上报修改
    */
    updateRent(params) {
        return request({
            url: `/houseSearch/rent`,
            method: 'Put',
            data: params
        })
    },
    /**
     * 租房上报删除
    */
    delRent(rentId) {
        return request({
            url: `/houseSearch/rent/${rentId}`,
            method: 'delete'
        })
    },
    /**
     * 装修材料列表
    */
    getDecoration() {
        return request({
            url: `houseSearch/decoration/list`,
            method: 'get'
        })
    }
}